package beanstao.util.response;

import beanstao.util.json.JsonLib;
import beanstao.util.store.domainobject.Domain;
import beanstao.util.store.domainobject.DomainList;


public class DomainListData extends PD
{
	private DomainListData()
	{
	}

	static DomainListData ME(@SuppressWarnings("rawtypes") DomainList domainList)
	{
		if (domainList.size() > 0)
		{
			int i = 0;
			while (i < domainList.size())
			{
				if (((Domain) domainList.get(i)).getIsDeleted())
				{
					domainList.remove(domainList.get(i));
					i--;
				}
				i++;
			}
		}
		DomainListData data = new DomainListData();
		data._responseData = domainList;
		return data;
	}

	@Override
	public String toJson()
	{
		if (null == _responseData)
		{
			this.logWarn("Response数据为空。");
			return null;
		}
		return JsonLib.fromObject(_responseData);
	}
}
